#ifndef NANE_WIN32KEYBOARD_H
#   define  NANE_WIN32KEYBOARD_H

#   include "nane/InputSystem/IInputDeviceSystem.h"
#   include "nane/core/WinAPI/winapi.h"

#   include <vector>

namespace nane
{

    struct KeyboardMessage
    {
        bool isDown;
        byte key;
        KeyboardMessage( bool _isDown, byte _key )
            : isDown( _isDown )
            , key( _key )
        {
        }
    };
    
    class Win32Keyboard
        : public IInputDeviceSystem
    {
    public:
        Win32Keyboard();
        ~Win32Keyboard();

        LRESULT WndProc( HWND _hWnd, UINT _msg, WPARAM _wParam, LPARAM _lParam );

    public:
        bool Initialize();
        void Shutdown();
        EInputDevice::raw_type GetDeviceType();
        bool InitializeContext( IWindow::OSHandle _windowHandle );
        void ShutdownContext();
        bool Poll( byte* _deviceNum, byte* _axis, int32* _value );

    private:
        HWND m_hWnd;
        WNDPROC m_wndProc;
        uint32 m_currentMessage;
        std::vector<KeyboardMessage> m_keyboardMessages;
    };
}

#endif	// NANE_WIN32KEYBOARD_H
